package co.salehi.validation;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import co.salehi.domain.Operator;

public class PasswordMatchnValidator implements
		ConstraintValidator<CheckPasswords, Operator> {
	@Override
	public void initialize(CheckPasswords constraintAnnotation) {

	}

	@Override
	public boolean isValid(Operator person, ConstraintValidatorContext context) {
		if (person == null)
			return true;
		return person.getPassword().equals(person.getPassword2());

	}

}
